var MessageRequest = {
    myMessages: function (aid, type, pageId, callback) {
        $.ajax({
            type: "post",
            url: "/message/myMessages",
            data: {
                id: aid,
                type: type,
                pageId: pageId
            },
            dataType: "json",
            success: function (result) {
                if (checkAjaxResult(result)) {
                    callback(result);
                } else {
                    layer.msg(result.msg);
                }
            }
        })
    },
    setMessageSelect: function (id, aid, type, callback) {
        $.ajax({
            type: "post",
            url: "/message/setMessageSelect",
            data: {
                cid: id,
                id: aid,
                type: type
            },
            dataType: "json",
            success: function (result) {
                if (checkAjaxResult(result)) {
                    callback(result);
                } else {
                    layer.msg(result.msg);
                }
            }
        })
    },
    deleteComment: function (id, aid, type, callback) {
        $.ajax({
            type: "post",
            url: "/message/deleteComment",
            data: {
                cid: id,
                id: aid,
                type: type
            },
            dataType: "json",
            success: function (result) {
                if (checkAjaxResult(result)) {
                    callback(result);
                } else {
                    layer.msg(result.msg);
                }
            }
        })
    },
    replyComment: function (id, content, callback) {
        $.ajax({
            type: "post",
            url: "/message/replyComment",
            data: {
                cid: id,
                content: content,
                addToSelect: 0
            },
            dataType: "json",
            success: function (result) {
                if (checkAjaxResult(result)) {
                    callback(result);
                } else {
                    layer.msg(result.msg);
                }
            }
        })
    }
};